// 角色管理列表查询
import request from '@/utils/request'
export function roleQuery(params) {
  return request({
    method: 'get',
    url: '/user/role/query',
    params
  })
}
// 新增角色
export function roleAdd(data) {
  return request({
    method: 'post',
    url: '/user/role/add',
    data: data
  })
}
// 编辑角色
export function roleUpdate(data, pkid) {
  return request({
    method: 'put',
    url: `/user/role/update/${pkid}`,
    data: data
  })
}
// 删除角色
export function roleDelete(pkid) {
  return request({
    method: 'delete',
    url: `/user/role/delete?pkid=${pkid}`
  })
}
// 新增角色授权
export function priRoleAdd(data) {
  return request({
    method: 'post',
    url: '/user/pri/role/add',
    data: data
  })
}
// 删除角色授权
export function priRoleDelete(roleId, resourceId) {
  return request({
    method: 'delete',
    url: `/user/pri/role/delete?roleId=${roleId}&resourceId=${resourceId}`
  })
}
// 角色授权模块权限树
export function priRoleMenuQuery(params) {
  return request({
    method: 'get',
    url: '/resource/datacatalog/tree/pri',
    params
  })
}

// 角色授权模块权限树
export function priRoleMenuQueryNew(params) {
  return request({
    method: 'get',
    url: '/resource/datacatalog/special/tree/pri',
    params
  })
}

// 编辑角色权限
export function priRoleSave(data) {
  return request({
    method: 'post',
    url: '/user/pri/role/addOrUpdate',
    data: data
  })
}
